﻿using MyData.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MyWeb.Controllers
{
    public class WXMobileController :BaseController
    {
        // GET: WXMobile
        public ActionResult WXUserInfo()
        {
            return View();
        }
        public ActionResult WXVisitor()
        {
            return View();
        }
        public JsonResult GetDeparts()
        {
            var departs = departApp.GetShowList();
            return Json(departs,JsonRequestBehavior.AllowGet);
        }
        public JsonResult SaveUserInfo(UserInfo userInfo)
        {
            return base.Try(() =>
            {
                userInfo.Id = Guid.NewGuid();
                userInfoApp.SaveConfirmUserInfo(userInfo);
            });
        }
        public JsonResult SaveVisitor(Visitor visitor)
        {
            return base.Try(() =>
            {
                visitor.Id = Guid.NewGuid();
                visitorApp.SaveConfirmVisitor(visitor);
            });
        }
        public ActionResult WXSuccess()
        {
            return View();
        }
    }
}